#pragma once

#include <boost/describe.hpp>

#include <algorithm/analytical_model/Constants.h>
#include <algorithm/shared/utils/Para.h>
#include <algorithm/shared/utils/Vec2.h>
#include <utils/HasValue.h>
#include <utils/ParaUtils.h>


#include <cstdint>
#include <memory>

namespace solar
{
    class Heliostat;
    class HeliostatWithGlassPara;

    /// \brief 场景参数-各定日镜单独设置的部分
    /// 若无特殊说明，Vec类型的分量顺序为(x, y, z)
    class HeliostatPara : public Para
    {
        public:
            HeliostatPara() = default;
#include <utils/class_name.inc>

        private:
            HeliostatType type_ = HeliostatType::kWithoutGlass;
            std::uint64_t heliostat_id_{static_cast<uint64_t>(kUndefined)};     // 定日镜编号
            std::uint64_t receiver_id_{static_cast<uint64_t>(kUndefined)};      // 接收器编号
            double mirror_area_ = kUndefined;  // 镜面面积（m^2）
            double total_area_ = kUndefined;   // 定日镜总面积（m^2）
            double reflectivity_ = kUndefined; // 反射率
            Vec2 sigma_tracking_{kUndefined, kUndefined};            // 跟踪误差（mrad）
            // 定日镜表面上（或含玻璃定日镜的下表面）的微表面法向扰动（mrad）
            Vec2 sigma_slope_error_{kUndefined, kUndefined};
            // 镜面为玻璃的定日镜的额外参数
            std::shared_ptr<HeliostatWithGlassPara> heliostat_glass_para_;

            // Auto-generated Part

            double air_attenuation_efficiency_ = kUndefined; // 大气透射效率
            double distance_to_focus_center_ = kUndefined; // 定日镜中心与聚焦点距离（m）
            double sigma_astigmatism_ = kUndefined;        // 散光误差（mrad）
            double sigma_beam_quality_ = kUndefined;       // 光束质量误差（mard）

            BOOST_DESCRIBE_CLASS(HeliostatPara, (Para), (), (),
                                 (type_, heliostat_id_, receiver_id_, mirror_area_, total_area_,
                                  reflectivity_, sigma_tracking_, sigma_slope_error_,
                                  heliostat_glass_para_, air_attenuation_efficiency_,
                                  distance_to_focus_center_, sigma_astigmatism_,
                                  sigma_beam_quality_))
    };
} // namespace solar

#define CURRENT_CLASS_NAME HeliostatPara
#include <utils/class_describe_header.inc>
SOLAR_DESCRIBE_CLASS(HeliostatPara, (Para), (), (),
                     (type_, heliostat_id_, receiver_id_, mirror_area_, total_area_, reflectivity_,
                      sigma_tracking_, sigma_slope_error_, heliostat_glass_para_,
                      air_attenuation_efficiency_, distance_to_focus_center_, sigma_astigmatism_,
                      sigma_beam_quality_))
